﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Contests.master" AutoEventWireup="false" CodeFile="ListContests.aspx.vb" Inherits="ListContests" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<h2>All Contests</h2>
<fieldset>
<legend>Contests</legend>
    <asp:GridView ID="dgContest" runat="server" DataSourceID="DSContests" 
        AutoGenerateColumns="False" DataKeyNames="ID">
        <Columns>
            <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="ContestDetails.aspx?ID={0}" 
                HeaderText="Vote" Text="Vote for Contest" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="RateContests.aspx?ID={0}" 
                HeaderText="Rate Contest" Text="Rate It" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="DSContests" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT [Title], [ID] FROM [tblContests]">
    </asp:SqlDataSource>
    </fieldset>
</asp:Content>

